<?php
Route::group(['prefix' => 'admin/entrust', 'namespace' => 'App\Http\Controllers\Admin'], function () {
    Route::get('role-list', 'EntrustController@getRoleList');
    Route::get('perm-list', 'EntrustController@getPermList');
    Route::get('user-list', 'EntrustController@getUserList');
    Route::get('user-add', 'EntrustController@getUserAdd');
    Route::get('user-edit', 'EntrustController@getUserEdit');
    Route::get('role-add', 'EntrustController@getRoleAdd');
    Route::get('role-edit', 'EntrustController@getRoleEdit');
    Route::get('perm-add', 'EntrustController@getPermAdd');
    Route::get('perm-edit/{id}', 'EntrustController@getPermEdit');
    Route::get('role-perms-list/{id}', 'EntrustController@getRolePermsList');
    Route::get('perm-role-list/{id}', 'EntrustController@getPermRoleList');
    Route::get('role-users-list/{id}', 'EntrustController@getRoleUsersList');
});

Route::group(['prefix' => 'api/entrust', 'namespace' => 'App\Http\Controllers\Api'], function () {
    Route::get('user-page-rows', 'EntrustController@getUserPageRows');
    Route::get('user-login-log', 'EntrustController@getUserLoginLog');
    Route::post('user-insert', 'EntrustController@postUserInsert');
    Route::post('user-update', 'EntrustController@postUserUpdate');
    Route::post('user-delete', 'EntrustController@postUserDelete');
    Route::post('user-import', 'EntrustController@postUserImport');
    Route::get('role-rows', 'EntrustController@getRoleRows');
    Route::post('role-insert', 'EntrustController@postRoleInsert');
    Route::post('role-update', 'EntrustController@postRoleUpdate');
    Route::post('role-delete', 'EntrustController@postRoleDelete');
    Route::post('perm-insert', 'EntrustController@postPermInsert');
    Route::post('perm-update', 'EntrustController@postPermUpdate');
    Route::post('perm-delete', 'EntrustController@postPermDelete');
    Route::get('member-rows', 'EntrustController@getMemberRows');
    Route::get('outer-member-rows', 'EntrustController@getOuterMemberRows');
    Route::get('member-info', 'EntrustController@getMemberInfo');
    Route::post('add-member', 'EntrustController@postAddMember');
    Route::post('remove-member', 'EntrustController@postRemoveMember');
    Route::post('grant-perm', 'EntrustController@postGrantPerm');
    Route::post('remove-perm', 'EntrustController@postRemovePerm');
});

Route::group(['prefix' => 'admin/department', 'namespace' => 'App\Http\Controllers\Admin'], function () {
    Route::get('ztree-rows', 'DepartmentController@getZtreeRows');
    Route::get('user-rows', 'DepartmentController@getUserRows');
    Route::post('create', 'DepartmentController@postCreate');
    Route::post('rename', 'DepartmentController@postRename');
    Route::post('delete', 'DepartmentController@postDelete');
});
